﻿<UserControl
						 x:Class="WaveTech.Scutex.Manager.Forms.LicenseSettings"
						 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
						 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
						 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
						 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Manager="clr-namespace:WaveTech.Scutex.Manager"
						 xmlns:themes="clr-namespace:WPF.Themes;assembly=WPF.Themes" mc:Ignorable="d" 
						 x:Name="licenseSettingsControl"
						 d:DesignHeight="350" d:DesignWidth="500">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/DataTemplates.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="150" />
			<RowDefinition />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<GroupBox Grid.Row="0" Grid.Column="0" Header="Master License Settings" Margin="4,4,4,4">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="30" />
					<RowDefinition Height="30" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Row="0" Grid.Column="0" Text="License Key Type:" VerticalAlignment="Center" />

				<ComboBox Grid.Row="0" Grid.Column="1" Margin="4,4,4,4" x:Name="cboLicenseKeyType" 
                ItemsSource="{Binding Source={StaticResource licenseKeyTypesEnumData}}" SelectionChanged="cboLicenseKeyType_SelectionChanged"
                SelectedItem="{Binding License.KeyGeneratorType, ElementName=licenseSettingsControl, Mode=TwoWay}" Height="Auto">
					<ComboBox.ItemTemplate>
						<DataTemplate>
							<Label  Content="{Binding   Path=.,Mode=OneWay, 
                                            Converter={StaticResource enumItemsConverter}}"
                                Height="Auto"
                                Margin="0" 
                                VerticalAlignment="Center"/>
						</DataTemplate>
					</ComboBox.ItemTemplate>
				</ComboBox>

			</Grid>
		</GroupBox>

		<GroupBox Grid.Row="0" Grid.Column="1" Header="License Service Settings" Margin="4,4,4,4">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="25" />
					<RowDefinition Height="37" />
					<RowDefinition Height="57*" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="95*" />
					<ColumnDefinition Width="88*" />
					<ColumnDefinition Width="47" />
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Row="0" Grid.Column="0" Text="License Service:" VerticalAlignment="Center" />
				<ComboBox Grid.Row="1" Grid.ColumnSpan="2" Margin="22,7,7,7" x:Name="cboService" ItemsSource="{Binding Source={StaticResource allServicesData}}" SelectedValue="{Binding License.Service, ElementName=licenseSettingsControl, Mode=TwoWay}" DisplayMemberPath="Name" />
			</Grid>
		</GroupBox>

		<GroupBox Grid.Row="1" Grid.Column="0" Header="License Sets (Editions)" Margin="4,4,4,4">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition Height="32" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<DataGrid x:Name="gridLicenseSets" Grid.Row="0" ItemsSource="{Binding License.LicenseSets, ElementName=licenseSettingsControl, Mode=TwoWay}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Single" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" themes:DataGridHelper.HorizontalMouseWheelScrollingEnabled="True">
					<DataGrid.Columns>
						<DataGridTextColumn
						Header="Name" Width="*" IsReadOnly="True"
						Binding="{Binding Path=Name}"/>
						<DataGridTextColumn
						Header="Types" Width="*" IsReadOnly="True"
						Binding="{Binding Path=SupportedLicenseTypes}"/>
					</DataGrid.Columns>
				</DataGrid>

				<Button Grid.Row="1" x:Name="btnSetLicenseSetFeatures" Margin="4,4,4,4" Content="Set License Set Features" Click="btnSetLicenseSetFeatures_Click" HorizontalAlignment="Left" />
				<Button Grid.Row="1" x:Name="btnRemoveLicenseSet" Margin="4,4,4,4" Content="Remove Selected" Click="btnRemoveLicenseSet_Click" HorizontalAlignment="Right" />
			</Grid>
		</GroupBox>

		<GroupBox Grid.Row="1" Grid.Column="1" Header="New License Set (Edition)" Margin="4,4,4,4">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="25" />
					<RowDefinition Height="30" />
					<RowDefinition />
					<RowDefinition Height="30" />
					<RowDefinition Height="25" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Row="0" Text="License Set (Edition) Name:" VerticalAlignment="Bottom" />
				<TextBox Grid.Row="1" x:Name="txtLicenseSetName"  Margin="4,4,4,4"/>

				<GroupBox Grid.Row="2" Header="Verification Types" Margin="2,2,2,2">
					<WrapPanel>
						<CheckBox x:Name="chkSingleUser" Content="Single User" Margin="2,2,2,2" />
						<CheckBox x:Name="chkMultiUser" Content="Multi User" Margin="2,2,2,2" />
						<CheckBox x:Name="chkHardwareLock" Content="Hardware Lock" Margin="2,2,2,2" />
						<CheckBox x:Name="chkUnlimited" Content="Unlimited" Margin="2,2,2,2" />
						<CheckBox x:Name="chkEnterprise" Content="Enterprise" Margin="2,2,2,2" />
						<CheckBox x:Name="chkSubscription" Content="Subscription" Margin="2,2,2,2" IsEnabled="False" />
					</WrapPanel>
				</GroupBox>

				<StackPanel  Grid.Row="3" Orientation="Horizontal">
					<TextBlock Grid.Row="0" Text="Max Multi Users:" VerticalAlignment="Center" />
					<TextBlock Width="5" />
					<TextBox Grid.Row="1" x:Name="txtMaxUsers" Width="50" Margin="4,4,4,4"/>
					<TextBlock Width="5" />
					<TextBlock Grid.Row="0" Text="Upgrade Only Set:" VerticalAlignment="Center" />
					<TextBlock Width="5" />
					<CheckBox x:Name="chkIsLicenseSetUpgradeOnly" Width="50" Margin="4,8,2,2" />
				</StackPanel>

				<Button Grid.Row="4" x:Name="btnAddLicenseSet" Content="Add License Set" HorizontalAlignment="Right" Click="btnAddLicenseSet_Click" />
			</Grid>
		</GroupBox>
	</Grid>
</UserControl>
